<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.nobody.facepk.pojo.SessionUser"%>
<%@page import="com.nobody.facepk.model.Picture"%>
<%@page import="com.nobody.facepk.model.Friends"%>
<%@page import="com.nobody.facepk.model.Comment"%>
<%@page import="com.nobody.facepk.sns.Event"%>
<%@page import="com.nobody.facepk.sns.EventType"%>
<%@page import="com.nobody.facepk.model.User"%>
<%@page import="com.nobody.facepk.view.MatchView"%>
<%@page import="com.nobody.facepk.service.PictureService"%>
<%@page import="com.nobody.facepk.service.ServiceRegistry"%>
<%@page import="com.nobody.facepk.service.UserService"%>
<%@page import="com.nobody.facepk.service.CommentService"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.List;"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>City Portal</title>
<meta name="keywords" content="city portal, 3 columns, free css templates, website templates, white color" />
<meta name="description" content="City Portal is a 3-column free website template for everyone" />
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">

$(function(){
		
		$("#testId img").click(function(){
			$(this).attr("src",this.src).css({"width":30,"height":30}).show(3000);
		});
		
		
		
	
});
</script>
<%
  SessionUser user = (SessionUser)request.getSession().getAttribute("SESSION_USER");
  //List  pictures = (List)request.getAttribute("pictures");
  //int picturesSize = pictures.size();
  List myFriends = (List)request.getAttribute("friends");
  List  scoringPictures = (List)request.getAttribute("scoringPictures");
  int scoringPicturesSize = scoringPictures.size();
  List endScoringPictures = (List)request.getAttribute("endScoringPictures");
  int endScoringPicturesSize = endScoringPictures.size();
  
  List events = (List)request.getAttribute("events");
 // int eventSize = events.size();
  //List freePictures  = (List)request.getAttribute("freePictures");
  
  List list_mv   = (List)request.getAttribute("list_mv");
  List list_end_mv = (List)request.getAttribute("list_end_mv");
  PictureService pictureService = ServiceRegistry.getPictureService();
  UserService    userService    = ServiceRegistry.getUserService();
  CommentService commentService    = ServiceRegistry.getCommentService();
  %>
</head>



<body>
<div id="templatmeo_wrapper">
  <div id="templatemo_header">
    <div id="site_title">
      <h1><a href="http://www.templatemo.com" target="_parent"> <img src="images/templatemo_logo.png" alt="City Portal" /> <span>FREE CSS TEMPLATES</span> </a></h1>
    </div>
    <!-- end of site_title -->
    
    <div id="header_right">
      <ul id="header_button">
        <li><a href="#"><img src="images/templatemo_home.jpg" alt="home" /></a></li>
        <li><a href="#"><img src="images/templatemo_contact.jpg" alt="contact us" /></a></li>
      </ul>
      <div class="cleaner"></div>
      <form action="#" method="get">
        <input type="text" value="Enter a keyword here..." name="q" size="10" id="searchfield" title="searchfield" onfocus="clearText(this)" onblur="clearText(this)" />
        <input type="submit" name="Search" value="Go" alt="Search" id="searchbutton" title="Search" />
      </form>
    </div>
  </div>
  <!-- end of templatemo_header -->
  
  <div id="templatemo_menu">
    <ul>
      <li><a href="#">Homepage1</a></li>
      <li><a href="#">Destinations</a></li>
      <li><a href="#">Life Style</a></li>
      <li><a href="#">Education</a></li>
      <li><a href="#">Sports</a></li>
      <li><a href="http://www.flashmo.com" target="_parent">Technology</a></li>
      <li><a href="#">Business</a></li>
      <li><a href="#">Photos</a></li>
      <li><a href="#">Videos</a></li>
    </ul>
  </div>
  <!-- end of templatemo_menu -->
  
  <div id="templatemo_content_wrapper">
    <div id="templatemo_left_sidebar">
      <div class="templatemo_box">
        <h2><span></span>我</h2>
        <div class="body">
         <div class="news_box"> <a href="#"><img class="news_image" src="images/templatemo_image_06.jpg" alt="image" /></a>
            <h3><a href="#">Praesent pretium diam quam</a></h3>
            <p>Praesent accumsan porta odio eget hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ut nunc nisl, in pellentesque mi.</p>
            <div class="cleaner"></div>
          </div>
        </div>
        <div class="box_bottom"><span></span></div>
      </div>
      <div class="templatemo_box">
        <h2><span></span>我的好友</h2>
        <div class="body">
          <ul class="side_menu">
          <%
    		for(int i = 0 ; i < myFriends.size() ; i ++){
    		User friend = (User)myFriends.get(i);
    		%>
            <li><a href="friendInfo.do?friendId=<%=friend.getId()%>&isMe=false"><%=friend.getName()%></a></li>
            <%
    		}
	    	 %>
          </ul>
                    <div class="more float_r"><a href="#">View All</a></div>
          <div class="cleaner"></div>
        </div>
        <div class="box_bottom"><span></span></div>
      </div>
      
      <div class="templatemo_box">
        <h2><span></span>可能认识</h2>
        <div class="body">
          <ul class="side_menu">
          <%
    		for(int i = 0 ; i < myFriends.size() ; i ++){
    		User friend = (User)myFriends.get(i);
    		%>
            <li><a href="friendInfo.do?friendId=<%=friend.getId()%>&isMe=false"><%=friend.getName()%></a></li>
            <%
    		}
	    	 %>
          </ul>
                    <div class="more float_r"><a href="#">View All</a></div>
          <div class="cleaner"></div>
        </div>
        <div class="box_bottom"><span></span></div>
      </div>
    </div>
    <!-- end of left_sidebar -->
    
   
    <div id="templatemo_content">
      <div class="templatemo_box">
        <h2><span></span>最新照片</h2>
        <div class="body" id="testId">
        <%
    	if(scoringPicturesSize == 0 ){%>
    	暂无图片。
    	<%}else{
    	if(scoringPicturesSize>2) scoringPicturesSize = 2; //首页最多显示6张
    	for(int i = 0 ; i < scoringPicturesSize ; i ++){
    	Picture  pic  = (Picture)scoringPictures.get(i);
    	String picPath = pic.getPath();
    	String picName = pic.getName();
    	String realPath = "pictures/"+pic.getUserId()+"/"+picPath;
    	
    	System.out.println(realPath);
    	%>
    	 
          <div class="news_box"><a href="#" ><img class="news_image"   width ="80" height="80" src="<%=realPath %>" alt="image" /></a>
            <h3><a href="#">查看详情</a></h3>
            <p>当前评论次数:<%=pic.getScoreCount() %>
    		    当前得分:<%=pic.getScore() %></p>
            <div class="cleaner"></div>
          </div>
    	<%
            }
    	 }if(scoringPictures.size()>2) {
    	%>
         <div class="more float_r"><a href="#">View All</a></div>
       <%} %>
        
          <div class="cleaner"></div>
        </div>
       
        
        <div class="box_bottom"><span></span></div>
      </div>
      <div class="templatemo_box">
        <h2><span></span>关注的照片</h2>
        <div class="body">
        
        <%
    	if(endScoringPicturesSize == 0 ){%>
    	暂无图片。
    	<%}else{
    	if(endScoringPicturesSize>2) endScoringPicturesSize = 2; //首页最多显示2张
    	for(int i = 0 ; i < endScoringPicturesSize ; i ++){
    	Picture  pic  = (Picture)endScoringPictures.get(i);
    	String picPath = pic.getPath();
    	String picName = pic.getName();
    	String realPath = "pictures/"+pic.getUserId()+"/"+picPath;
    	%>
          <div class="news_box"> <a href="#"><img class="news_image" width="80" height="80" src="<%=realPath %>" alt="image" /></a>
            <h3><a href="#">查看详情</a></h3>
            <p>当前得分:<%=pic.getScore() %></p>
            <div class="cleaner"></div>
          </div>
           	<%
            }
    	 }
    	if(endScoringPictures.size()>2){
    	%>
       <div class="more float_r"><a href="#">View All</a></div>
       <%
       }
        %>
          
          
          
          <div class="cleaner"></div>
        </div>
        <div class="box_bottom"><span></span></div>
      </div>
    </div>
    <!-- end of templatemo_content -->
    
    <div id="templatemo_right_sidebar">
      <div class="templatemo_box">
        <h2><span></span>谁来看过我</h2>
        <div class="body">
          <ul class="side_menu">
            <li><a href="#">Donec quam</a></li>
            <li><a href="#">Nulla consequat</a></li>
            <li><a href="#">In enim justo</a></li>
            <li><a href="#">Aenean vulputate</a></li>
            <li><a href="#">Etiam ultricies</a></li>
            <li><a href="#">Nullam quis</a></li>
            <li><a href="#">Sed consequat</a></li>
            <li><a href="#">Cras dapibus</a></li>
          </ul>
                    <div class="more float_r"><a href="#">View All</a></div>
          <div class="cleaner"></div>
        </div>
        <div class="box_bottom"><span></span></div>
      </div>

    </div>
    <!-- end of right_sidebar -->
    
    <div class="cleaner"></div>
  </div>
  <!-- end of templatemo_content_wrapper --> 
  
</div>
<!-- end of templatemo_wrapper -->

<div id="templatemo_footer_wrapper">
  <div id="templatemo_footer">
    <ul class="footer_menu">
      <li><a href="#">Homepage</a></li>
      <li><a href="#">Destinations</a></li>
      <li><a href="#">Life Style</a></li>
      <li><a href="#">Environments</a></li>
      <li><a href="#">Sports</a></li>
      <li><a href="#">Technology</a></li>
      <li><a href="#">Business</a></li>
      <li><a href="#">Videos</a></li>
      <li class="last_menu"><a href="#">Contact</a></li>
    </ul>
    Copyright © 2048 <a href="#">Your Company Name</a> | <a href="http://www.iwebsitetemplate.com" target="_parent">Website Templates</a> by <a href="http://www.templatemo.com" target="_parent">Free CSS Templates</a></div>
  <!-- end of footer --> 
</div>
<!-- end of templatmeo_footer_wrapper -->
</body>
</html>